package ch03_singleton.clonesingleton;

import java.lang.reflect.Method;

/**
 *
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class MainTest {
    public static void main(String[] args) throws Exception {
        CloneSingleton obj1 = CloneSingleton.getInstance();
        Method method = CloneSingleton.class.getDeclaredMethod("clone");
        method.setAccessible(true);
        CloneSingleton obj2 = (CloneSingleton) method.invoke(obj1);
        System.out.println(obj1 == obj2);
    }
}
